#ifndef __THREAD_POOL__
#define __THREAD_POOL__

#include <atomic>
#include "IUtility.h"
#include "IThreadPoolManager.h"
#include "ISysResources.h"
#include "IPacket.h"
#include "IContainer.h"

class CThreadPool : public virtual IThreadPool
{
INIT_CLASS_PRODUCT(CThreadPool)
public:
	const bool Init(const void * pvdPara, char * pszMsgTxt, int iMsgTxtSize);
	const void UnInit();

	void Start();
	void Pause();
	void Stop();
	int ThreadPoolState();
	int ThreadCount();
	int Interval();
	const char * BusProClsName();
	const char * InQueueName();
	const char * OutQueueName();
	const char * TriggerThreadPoolName();
	IQueueOperation & QueueOperation();
	IInterProcessCommunication & IPC();

private:
	vector<shared_ptr< ITrigger >> m_vtTrigger;
	vector<shared_ptr< IThread >> m_vtThreadPool;
	atomic<bool> m_bStopFlg, m_bPauseFlg;
	atomic<int> m_iThreadPoolState;
	int m_iInterval, m_iThreadCount, m_iInQueueType, m_iOutQueueType;
	string m_strBusProClsName, m_strInQueueName, m_strOutQueueName, m_strTriggerThreadPoolName;
};



#endif//__THREAD_POOL__